package puntaelena.graphsupport;

import java.util.Arrays;

public class Graph {
	public static final double DEFAULT_INF_EDGE = 1e30;

	private int vertexCount;
	private double[][] adjacentMatrixArr;
	private double infEdge = DEFAULT_INF_EDGE;

	public Graph(int vertexCount) {
		this.vertexCount = vertexCount;
		adjacentMatrixArr = new double[vertexCount][vertexCount];
		for (double[] d : adjacentMatrixArr) {
			Arrays.fill(d, infEdge);
		}
	}

	public int getVertexCount() {
		return vertexCount;
	}

	public double[][] getAdjacentMatrixArr() {
		return adjacentMatrixArr;
	}

	public double getInfEdgeValue() {
		return infEdge;
	}

	public boolean existsEdge(int from, int to) {
		return adjacentMatrixArr[from][to] < infEdge;
	}
}
